import type { RouteRecordRaw } from 'vue-router'
import frontendBaseRoute, { frontendBaseRoutePath } from './frontend/base'
import backendBaseRoute, { backendBaseRoutePath } from './backend/base'


const baseRoutes: Array<RouteRecordRaw> = [
    {
        path: backendBaseRoutePath + '/login',
        name: 'adminLogin',
        component: () => import('@/views/backend/Login.vue'),
    },
    {

        path: frontendBaseRoutePath + '/login',
        name: 'userLogin',
        component: () => import('@/views/frontend/Login.vue'),
    },
    {

        path: '/401',
        name: 'noPower',
        component: () => import('@/views/common/error/401.vue'),
    },
    {
        path: '/404',
        name: 'notFound',
        component: () => import('@/views/common/error/404.vue'),
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
    },
]

const staticRoutes: Array<RouteRecordRaw> = [
    ...baseRoutes,
    backendBaseRoute,
    frontendBaseRoute
]
export default staticRoutes